<html>
<head><meta charset="utf-8"><title>measuring code size · project-ffi-unwind · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/index.html">project-ffi-unwind</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/measuring.20code.20size.html">measuring code size</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="180209406"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/measuring%20code%20size/near/180209406" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/measuring.20code.20size.html#180209406">(Nov 08 2019 at 07:58)</a>:</h4>
<p>the rough numbers I have are, panic=abort reduces the size of a binary by 10%-20% on Fuchsia</p>



<a name="180219620"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/measuring%20code%20size/near/180219620" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/measuring.20code.20size.html#180219620">(Nov 08 2019 at 10:59)</a>:</h4>
<p><span class="user-mention" data-user-id="116883">@tmandry</span> it might be interesting to try building fuchsia with <code>-C panic=unwind</code> and a nightly toolchain from July, and then compare that with the current nightly toolchain.</p>



<a name="180219649"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/measuring%20code%20size/near/180219649" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/measuring.20code.20size.html#180219649">(Nov 08 2019 at 10:59)</a>:</h4>
<p>IIRC the current toolchain does not emit <code>nounwind</code> for extern C, while the one in July should do that.</p>



<a name="180219692"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/measuring%20code%20size/near/180219692" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/measuring.20code.20size.html#180219692">(Nov 08 2019 at 11:00)</a>:</h4>
<p>That would show the impact of this particular change there.</p>



<a name="180219747"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/measuring%20code%20size/near/180219747" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/measuring.20code.20size.html#180219747">(Nov 08 2019 at 11:01)</a>:</h4>
<p>the last numbers I gathered were from July/August timeframe</p>



<a name="180219757"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/measuring%20code%20size/near/180219757" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/measuring.20code.20size.html#180219757">(Nov 08 2019 at 11:01)</a>:</h4>
<p><span class="user-mention" data-user-id="132920">@gnzlbg</span> if you can point me to a particular change to apply/revert I could also do that</p>



<a name="180219770"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/measuring%20code%20size/near/180219770" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/measuring.20code.20size.html#180219770">(Nov 08 2019 at 11:01)</a>:</h4>
<p>the numbers might be a little noisy with other changes mixed in there</p>



<a name="180219863"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/measuring%20code%20size/near/180219863" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/measuring.20code.20size.html#180219863">(Nov 08 2019 at 11:03)</a>:</h4>
<p><span class="user-mention" data-user-id="116883">@tmandry</span> let me check</p>



<a name="180219923"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/measuring%20code%20size/near/180219923" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/measuring.20code.20size.html#180219923">(Nov 08 2019 at 11:04)</a>:</h4>
<p><span class="user-mention" data-user-id="120791">@RalfJ</span> I see <a href="https://github.com/rust-lang/rust/pull/65346" target="_blank" title="https://github.com/rust-lang/rust/pull/65346">https://github.com/rust-lang/rust/pull/65346</a> and <a href="https://github.com/rust-lang/rust/pull/65020" target="_blank" title="https://github.com/rust-lang/rust/pull/65020">https://github.com/rust-lang/rust/pull/65020</a> landed but it appears that none of these removed <code>nounwind</code> from all <code>extern "C"</code> definitions and declarations, did that happen somewhere already?</p>



<a name="180219937"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/measuring%20code%20size/near/180219937" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/measuring.20code.20size.html#180219937">(Nov 08 2019 at 11:04)</a>:</h4>
<p>Ah  <a href="https://github.com/rust-lang/rust/pull/63909" target="_blank" title="https://github.com/rust-lang/rust/pull/63909">https://github.com/rust-lang/rust/pull/63909</a> is not merged.</p>



<a name="180219941"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/measuring%20code%20size/near/180219941" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/measuring.20code.20size.html#180219941">(Nov 08 2019 at 11:04)</a>:</h4>
<p><span class="user-mention" data-user-id="116883">@tmandry</span> you might want to apply <a href="https://github.com/rust-lang/rust/pull/63909" target="_blank" title="https://github.com/rust-lang/rust/pull/63909">https://github.com/rust-lang/rust/pull/63909</a> to the current nightly.</p>



<a name="180219980"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/measuring%20code%20size/near/180219980" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/measuring.20code.20size.html#180219980">(Nov 08 2019 at 11:05)</a>:</h4>
<p>then you can just compare the current nightly with that PR, in both cases with <code>-C panic=unwind</code></p>



<a name="180219995"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/measuring%20code%20size/near/180219995" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/measuring.20code.20size.html#180219995">(Nov 08 2019 at 11:06)</a>:</h4>
<p>that should show the effect of making <code>extern "C"</code> definitions and declarations allow unwinding by default</p>



<a name="180234812"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/measuring%20code%20size/near/180234812" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/measuring.20code.20size.html#180234812">(Nov 08 2019 at 14:37)</a>:</h4>
<p>I'm breaking this out into a distinct topic</p>



<a name="180234827"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/measuring%20code%20size/near/180234827" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/measuring.20code.20size.html#180234827">(Nov 08 2019 at 14:37)</a>:</h4>
<p>Thanks <span class="user-mention" data-user-id="116883">@tmandry</span> for those numbers! Very helpful to have an upper bound, and I agree the impact is non-trivial</p>



<a name="180234842"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/measuring%20code%20size/near/180234842" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/measuring.20code.20size.html#180234842">(Nov 08 2019 at 14:37)</a>:</h4>
<p>Given that the impact is non-trivial, it seems like it is worth trying to dig in more, since the impact of these alternatives would be more limited, and it seems like it matters</p>



<a name="180244771"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/measuring%20code%20size/near/180244771" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/measuring.20code.20size.html#180244771">(Nov 08 2019 at 16:15)</a>:</h4>
<p>I think at this point</p>



<a name="180244779"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/measuring%20code%20size/near/180244779" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/measuring.20code.20size.html#180244779">(Nov 08 2019 at 16:15)</a>:</h4>
<p>these measurements are the single most important thing to do</p>



<a name="180244833"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/measuring%20code%20size/near/180244833" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/measuring.20code.20size.html#180244833">(Nov 08 2019 at 16:16)</a>:</h4>
<p>I think <span class="user-mention" data-user-id="132920">@gnzlbg</span> what we really want to compare is</p>



<a name="180244849"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/measuring%20code%20size/near/180244849" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/measuring.20code.20size.html#180244849">(Nov 08 2019 at 16:16)</a>:</h4>
<p>what is the cost if we insert "abort" shims around "C" FFI calls, but otherwise use <code>-Cpanic=abort</code></p>



<a name="180244861"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/measuring%20code%20size/near/180244861" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/measuring.20code.20size.html#180244861">(Nov 08 2019 at 16:16)</a>:</h4>
<p>I don't think we can estimate that yet, do we need to do a prototype impl to do so?</p>



<a name="180244882"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/measuring%20code%20size/near/180244882" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/measuring.20code.20size.html#180244882">(Nov 08 2019 at 16:16)</a>:</h4>
<p>(Maybe <span class="user-mention" data-user-id="143274">@Amanieu</span> is interested in doing so?)</p>



<a name="180285590"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/measuring%20code%20size/near/180285590" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> BatmanAoD (Kyle Strand) <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/measuring.20code.20size.html#180285590">(Nov 09 2019 at 00:10)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> do you have a sense of what threshold should be considered "significant", and how it would impact our design decisions? The data is interesting, but I'm having a little trouble tracking how it will inform our next steps.</p>



<a name="180294550"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/measuring%20code%20size/near/180294550" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/measuring.20code.20size.html#180294550">(Nov 09 2019 at 03:45)</a>:</h4>
<p>The size might determine whether it's reasonable to have C default to unwind or nounwind.</p>



<a name="180294554"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/measuring%20code%20size/near/180294554" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/measuring.20code.20size.html#180294554">(Nov 09 2019 at 03:45)</a>:</h4>
<p>Or at least the impact of those choices.</p>



<a name="180459589"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/measuring%20code%20size/near/180459589" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/measuring.20code.20size.html#180459589">(Nov 11 2019 at 21:01)</a>:</h4>
<blockquote>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> do you have a sense of what threshold should be considered "significant", and how it would impact our design decisions? The data is interesting, but I'm having a little trouble tracking how it will inform our next steps.</p>
</blockquote>
<p>I feel like 10% is significant</p>



<a name="180459605"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/measuring%20code%20size/near/180459605" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/measuring.20code.20size.html#180459605">(Nov 11 2019 at 21:01)</a>:</h4>
<p>I'm not saying &lt;10% is not significant :)</p>



<a name="180459662"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/measuring%20code%20size/near/180459662" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/measuring.20code.20size.html#180459662">(Nov 11 2019 at 21:02)</a>:</h4>
<p>I guess I think the threshold is probably somewhere around 2 or 3%? I don't really know.</p>



<a name="180459679"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/measuring%20code%20size/near/180459679" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/measuring.20code.20size.html#180459679">(Nov 11 2019 at 21:02)</a>:</h4>
<p>I'd prefer to have the number because there are certain things where it's clear -- 0.1%, or 10% :)</p>



<a name="180459692"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/measuring%20code%20size/near/180459692" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/measuring.20code.20size.html#180459692">(Nov 11 2019 at 21:02)</a>:</h4>
<p>in other words, I don't think there is a <em>firm</em> threshold</p>



<a name="180463839"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/measuring%20code%20size/near/180463839" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> BatmanAoD (Kyle Strand) <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/measuring.20code.20size.html#180463839">(Nov 11 2019 at 21:59)</a>:</h4>
<p>Okay, that's fair enough.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>